package com.itany.corejava.code01_基础;

/**
 * @author 石小俊
 * @date 2023年04月07日 11:20
 */
public class Test03_基本数据类型 {
    public static void main(String[] args) {
        byte b = 127;
        b = -128;
        // b = 128; // 报错,超出了byte的范围
        short s = 32767;
        // s = 32768; // 报错,超出了short的范围
        System.out.println(Math.pow(2, 31));
        int i = 2147483647;
        // i = 2147483648; // 报错,超出了int的范围
        // 打印的数字默认使用int处理
        System.out.println(2147483647);
        // 当超出int范围时会报错
        // System.out.println(2147483648);

        long l = 2147483648l;
        l = 2147483648L;

        float f = 3.14f;
        f = 5.16F;

        double d = 3.14;
        d = 5.16;
        System.out.println(123.45);

        char c = 'a';
        c = '1';
        c = '#';
        c = '中';
        c = '\n';
        c = '\t';
        char c2 = 'a';
        System.out.print("Hello World");
        System.out.print(c);
        System.out.print("Hello World");
        c = '\u0061';
        c = c2;
        System.out.println(c);

        boolean flag = true;
        System.out.println(flag);
        flag = false;
        System.out.println(flag);
        int age = 18;
        System.out.println(age < 20);

        String name = "李白";
        System.out.println(name + age);
        String num1 = "1";
        String num2 = "2";
        System.out.println(num1 + num2);
        int num3 = 1, num4 = 2;
        System.out.println(num3+num4);
    }
}

